	(function(window){
	//获取当前浏览器窗口
	var width = document.documentElement.clientWidth || document.body.clientWidth;
	//设置根节点的font-size
	document.documentElement.style.fontSize = width / 10 + "px";
	//当窗口大小变化时触发resize事件
	window.onresize = function(){
		//设置根节点的font-size
		document.documentElement.style.fontSize = (document.documentElement.clientWidth || document.body.clientWidth ) / 10 + "px"
	}
	})(window);
	app.controller("new1Controller",["$scope",function($scope){
		$scope.shou1 = function (){
			window.location.href='http://localhost/JPW/index.html#/mine';
		}
		//验证手机号
		var shouji=document.getElementsByClassName("zhanghan")[0],
		dian = document.getElementsByClassName("dian")[0],
		text = document.getElementsByClassName("text")[0],
		geshi = document.getElementsByClassName("geshi")[0],
		zhe = document.getElementsByClassName("zhezhao")[0]
		wrong = document.getElementsByClassName("wrong")[0];
		function  shoujihao(){
			var shoujiname=/^1[3,5,7,8]\d{9}$/;
			var hh = shouji.value.length;
			if (hh >= 11) {
				if (!(shoujiname.test(shouji.value))) {
					
					geshi.style.display = "block"
					return false;
				}
				dian.style.color="red"
				return true;
			}else{
				geshi.style.display = "none"
				dian.style.color="#757575"
			};
			
		}
		shouji.oninput=shoujihao;
		shouji.onfocus = function(){
			geshi.style.display = "none"
		}
		//验证码
		var cun = document.getElementsByClassName("cun")[0];
		function chansheng(){
			wrong.style.display = "none"
			cun.innerHTML="";
			var h=""
			var str="0123456789abcdefjhijklmnopqrstuvwxyzABCDEFJHIJKLMNOPQRSTUVWXYZ";
			
		       	for (var i = 0; i < 4; i++) {
		       	var a=parseInt(Math.random()*62);
		           h+=str[a];
		       } 
		        cun.innerHTML=h;       
		}
		dian.onclick=chansheng;
		cun.onclick = chansheng;
		chansheng();
		document.getElementById("tijiao").onclick = function(){
			if (cun.innerHTML == text.value) {
				zhe.style.display = "none";
				wrong.style.display = "none"
			}else{
				chansheng()
				wrong.style.display = "block"
			};
		}
	}])
